package com.xing.serviceedu.client;

import com.xing.commonutils.user.UcenterMemberOrder;
import com.xing.serviceedu.client.impl.UcenterClientImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Component //控制反转，交给spring管理
//卧槽，成了估计是地址的问题,调用外部接口，不是本地的，需要写上外部接口的地址的
//@FeignClient(name = "service-ucenter", url = "172.29.12.23:8160", fallback = UcenterClientImpl.class)
public interface UcenterClient {

    /**
     * 根据用户id获取用户信息
     *
     * @param id
     * @return
     */
//    @RequestMapping(method = RequestMethod.GET, value = "/u/getUserInfoOrder/{id}") 能用的
    @GetMapping("/u/getUserInfoOrder/{id}")
    //也能用的
    UcenterMemberOrder getUserInfoOrder(@PathVariable("id") String id);

}
